#-*-coding:utf-8 -*-
################################################################
#
# Copyright (c) 2019 SenseAge LLC. All rights reserved.
#
###############################################################
"""
author: 
data: 2019/7/20
doc:
日期计算模块
notice:
"""


import datetime as dt

def pass_day(passed_day):
    """ 计算过去passed_day天的日期，从那一天的0时刻计算起
    """
    today = dt.datetime.now()
    offset = dt.timedelta(days=-passed_day)

    query_day = today+offset
    y, m, d = query_day.year, query_day.month, query_day.day
    # 够造改天的datetime格式
    #query_day = dt.datetime(y, m, d)    
    #return query_day
    return y, m, d
